package com.ruoyi.account.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.BillInfoChannelMapper;
import com.ruoyi.db.domain.BillInfoChannel;
import com.ruoyi.account.service.IBillInfoChannelService;
import com.ruoyi.common.core.text.Convert;

/**
 * 渠道账单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-02
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class BillInfoChannelServiceImpl implements IBillInfoChannelService 
{
    @Autowired
    private BillInfoChannelMapper billInfoChannelMapper;

    /**
     * 查询渠道账单信息
     * 
     * @param id 渠道账单信息主键
     * @return 渠道账单信息
     */
    @Override
    public BillInfoChannel selectBillInfoChannelById(Long id)
    {
        return billInfoChannelMapper.selectBillInfoChannelById(id);
    }

    /**
     * 查询渠道账单信息列表
     * 
     * @param billInfoChannel 渠道账单信息
     * @return 渠道账单信息
     */
    @Override
    public List<BillInfoChannel> selectBillInfoChannelList(BillInfoChannel billInfoChannel)
    {
        return billInfoChannelMapper.selectBillInfoChannelList(billInfoChannel);
    }

    /**
     * 查询渠道账单信息列表
     *
     * @param billInfoChannel 渠道账单信息
     * @return 渠道账单信息
     */
    @Override
    public List<Map<String, Object>> selectBillInfoChannelListMap(BillInfoChannel billInfoChannel)
    {
        return billInfoChannelMapper.selectBillInfoChannelListMap(billInfoChannel);
    }

    /**
     * 新增渠道账单信息
     * 
     * @param billInfoChannel 渠道账单信息
     * @return 结果
     */
    @Override
    public int insertBillInfoChannel(BillInfoChannel billInfoChannel)
    {
        billInfoChannel.setCreateTime(DateUtils.getNowDate());
        return billInfoChannelMapper.insertBillInfoChannel(billInfoChannel);
    }

    /**
     * 修改渠道账单信息
     * 
     * @param billInfoChannel 渠道账单信息
     * @return 结果
     */
    @Override
    public int updateBillInfoChannel(BillInfoChannel billInfoChannel)
    {
        billInfoChannel.setUpdateTime(DateUtils.getNowDate());
        return billInfoChannelMapper.updateBillInfoChannel(billInfoChannel);
    }

    /**
     * 批量删除渠道账单信息
     * 
     * @param ids 需要删除的渠道账单信息主键
     * @return 结果
     */
    @Override
    public int deleteBillInfoChannelByIds(String ids)
    {
        return billInfoChannelMapper.deleteBillInfoChannelByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除渠道账单信息信息
     * 
     * @param id 渠道账单信息主键
     * @return 结果
     */
    @Override
    public int deleteBillInfoChannelById(Long id)
    {
        return billInfoChannelMapper.deleteBillInfoChannelById(id);
    }
}
